﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using XCommon.Types;

namespace WebDemo
{
    public partial class _Default : System.Web.UI.Page
    {
        private List<Ps> _selectlist = null;

        protected void Page_Load(object sender, EventArgs e)
        {
            string ty = Request.QueryString["ty"] ?? Request.Form["ty"] ?? "";
            switch (ty.ToLower())
            {
                case "insert":
                    Insert();
                    break;
                case "delete":
                    Delete();
                    break;
                case "update":
                    Update();
                    break;
            }
        }

        public void Insert()
        {
            XDAL.DemoGroupTypeOperate.It.CreateInsert();
        }
        public void Delete()
        {
            XDAL.DemoGroupTypeOperate.It.CreateDelete();
        }
        public void Update()
        {
            XDAL.DemoGroupTypeOperate.It.CreateUpdate();
        }

        public List<Ps> SelectList
        {
            get
            {
                if (_selectlist == null)
                {
                    _selectlist = XDAL.tbGuoupType.It.Select();
                }
                return _selectlist;
            }
        }
    }
}